package edu.neusoft.yiqibike.controller;

import edu.neusoft.yiqibike.common.entity.vo.Response;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.UnauthenticatedException;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * User：lyc
 * Date：2017-12-24
 * Time：14:25
 * Description：
 */
@RestController
@RequestMapping("/error")
public class ErrorController {

    @RequestMapping("/login")
    public Response<String> unauthorized() {
        SecurityUtils.getSubject().logout();
        throw new UnauthenticatedException();
    }
}